// Copyright (C) 2011  Andrew H. Chan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

#ifndef _LARSSONSADAKANE_H__
#define _LARSSONSADAKANE_H__

#include <vector>

typedef unsigned long long uint64;

class LarssonSadakane {
    public:
        static bool suffixLessThan(std::vector<uint64> const &T, uint64 a, uint64 b);
        static std::string getSuffix(std::vector<uint64> const& T, uint64 index);
        static void qsort(uint64 h, std::vector<uint64> &V, std::vector<uint64> &SA, std::vector<bool> &L, uint64 index, uint64 length);
        static int verifyInverseSuffixArray(std::vector<uint64> const &T, std::vector<uint64> const &V, int printSuffixes=0);
        static void computeInverseSuffixArray(std::vector<uint64> &V);
};

#endif
